//
//  EnemyObj.h
//  NinjaTurtle
//
//  Created by Nguyen Tri Chung on 2/6/15.
//
//

#ifndef __NinjaTurtle__EnemyObj__
#define __NinjaTurtle__EnemyObj__

#include <stdio.h>
#include "cocos2d.h"
#include "Obj.h"

USING_NS_CC;

class EnemyObj : public Obj {
    CC_SYNTHESIZE(MoveState, moveState, MoveState);
    CC_SYNTHESIZE(string, enemyName, EnemyName);
    CC_SYNTHESIZE(bool, equipable, Equipable);
    CC_SYNTHESIZE(bool, trappable, Trappable);
    
    CC_SYNTHESIZE(bool, walkable, Walkable);
    CC_SYNTHESIZE(bool, fireable, Fireable);
    CC_SYNTHESIZE(float, moveSpeed, MoveSpeed);
    CC_SYNTHESIZE(float, currentElapsedJumpTime, CurrentElapsedJumpTime);
    CC_SYNTHESIZE(float, lastStepY, LastStepY);
    CC_SYNTHESIZE(RectBody*, visualRange, VisualRange);
    
    CC_SYNTHESIZE(bool, machinable, Machinable);
    CC_SYNTHESIZE(float, currentDelayToFire, CurrentDelayToFire);
    CC_SYNTHESIZE(float, fireX, FireX);
    CC_SYNTHESIZE(float, fireY, FireY);
    
    CC_SYNTHESIZE(bool, crusherable, Crusherable);
    CC_SYNTHESIZE(float, currentDelayToCrush, CurrentDelayToCrush);
    CC_SYNTHESIZE(float, maxDelayToCrush, MaxDelayToCrush);
    
    CC_SYNTHESIZE(bool, aimable, Aimable);
public:
    EnemyObj(const string& identifier);
    EnemyObj(const string& identifier, const string& animation);
    EnemyObj(const string& identifier, const vector<string>& animations);
    void initEnemy();
    virtual ~EnemyObj();
    void update(float dt);
    bool fire(float dt);
    
    string getStateMove();
    string getStateIdle();
    string getStateThrow();
};

#endif /* defined(__NinjaTurtle__EnemyObj__) */
